<template>
  <div>
    <Row class="search-info-style">
      <Col span="6">
        <span>姓&ensp;&ensp;&ensp;名&ensp;：</span>
        <Input v-model="params.name" placeholder="姓名" style="width:70%" />
      </Col>
      <Col span="6">
        <span>证件号码：</span>
        <Input v-model="params.card_no" placeholder="证件号码" style="width:70%" />
      </Col>
      <Col span="6">
        <span>所在区县：</span>
        <Input v-model="params.area" placeholder="所在区县" style="width:70%" />
      </Col>
      <Col style="float:right" pull="1">
        <Button class="new-btn-sty" @click="findtime()"><Icon type="ios-search" /> 搜索</Button>
      </Col>
    </Row>
    <Row class="search-info-style">
      <Col span="6">
        <span>所在街道：</span>
        <Input v-model="params.street" placeholder="所在街道" style="width:70%" />
      </Col>
      <Col span="6">
        <span>所在社区：</span>
        <Input v-model="params.community" placeholder="所在社区" style="width:70%" />
      </Col>
    </Row>
    <Table border :columns="columns1" :data="data1"></Table>
    <Row v-if="loadData == true">
      <Col class="demo-spin-col" span="8" offset="8">
        <Spin fix>
          <Icon type="ios-loading" size=18 class="demo-spin-icon-load"></Icon>
          <div>数据正在加载</div>
        </Spin>
      </Col>
    </Row>
    <Page :total="totalnum" :current="currentPageNo" :page-size="currentPageSize" @on-change="matterPage" class="page_style" show-sizer @on-page-size-change="SXsize"/>
  </div>
</template>
<script>
import { getRegionsendOlseeList } from '@/api/yi-qing-fang-kong'
export default {
  data () {
    return {
      loadData: true,
      totalnum: 0,
      currentPageNo: 1,
      currentPageSize: 10,
      params: {},
      columns1: [
        { title: '序号', type: 'index', width: 70, align: 'center' },
        { title: '姓名', key: 'name', width: 100, align: 'center' },
        { title: '证件号码', key: 'card_no', width: 150, align: 'center' },
        { title: '性别', key: 'sex', width: 100, align: 'center' },
        { title: '手机号', key: 'mobile', width: 150, align: 'center' },
        { title: '所在区县', key: 'area', width: 100, align: 'center' },
        { title: '所在街道', key: 'street', width: 100, align: 'center' },
        { title: '所在社区', key: 'community', width: 100, align: 'center' },
        { title: '地址', key: 'address', width: 150, align: 'center' },
        { title: '到沈时间', key: 'arrive_time', width: 100, align: 'center' },
        { title: '交通方式', key: 'arrive_type', width: 100, align: 'center' },
        { title: '交通方式号码(车次/车牌号)', key: 'arrive_type_remark', width: 100, align: 'center' },
        { title: '来源地省', key: 'originate_province', width: 100, align: 'center' },
        { title: '来源地市', key: 'originate_city', width: 100, align: 'center' }
      ],
      data1: []
    }
  },
  methods: {
    init () {
      this.params.pageNo = this.currentPageNo
      this.params.pageSize = this.currentPageSize
      this.data1 = []
      this.loadData = true
      getRegionsendOlseeList(this.params).then(res => {
        if (res.data.errcode === 0) {
          this.data1 = res.data.data.results
          this.totalnum = res.data.data.totalRecord
          this.loadData = false
        } else {
          this.$Notice.error({ title: '获取列表失败', desc: res.errmsg })
          this.loadData = false
        }
      })
    },
    findtime () {
      this.currentPageNo = 1
      this.currentPageSize = 10
      this.init()
    },
    matterPage (pageNo) {
      this.currentPageNo = pageNo
      this.init()
    },
    SXsize (pageSize) {
      this.currentPageSize = pageSize
      this.init()
    }
  },
  mounted () {
    this.init()
  }
}
</script>
<style>
  .page_style {
    margin-top: 10px;
    text-align: right;
  }
  .item1{
    height: 42px;
    line-height: 40px;
  }
  .search-info-style {
    margin: 10px;
  }
  .new-btn-sty {
    margin-right: 5px;
    color: #fff;
    background-color: #235CA7;
    border-color: #235CA7;
    font-weight: 500;
  }
</style>
